/*----------------------------------------------------------------------
  - File name      : STC8Ax_RST.c
  - Author         : Quark Team
  - Update date    : 2020-12-11
  -	Copyright      : Gevico Electronic studio   
  - Module comments: Reset module.
-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------
|                               INCLUDES                                |
-----------------------------------------------------------------------*/
#include "STC8Ax_RST.h"
/*-----------------------------------------------------------------------
|                                 DATA                                  |
-----------------------------------------------------------------------*/
/* None */
/*-----------------------------------------------------------------------
|                               FUNCTION                                |
-----------------------------------------------------------------------*/
/*--------------------------------------------------------
| @Description: Software reset function                  |
| @param      : RSTChoice_Type Choice, FUNSTATE State    |
| @return     : FSCSTATE : Success / Fail                |
--------------------------------------------------------*/

FSCSTATE SFW_RST_Ctrl(RSTChoice_Type Choice, FUNSTATE State)
{
	IAP_CONTR = (IAP_CONTR & 0xBF) | (Choice << 6);
	IAP_CONTR = (IAP_CONTR & 0xDF) | (State << 5);
	return FSC_SUCCESS;
}

/*--------------------------------------------------------
| @Description: Low voltage reset initialization function|
| @param      : RSTPinMode_Type PinMode                  |
|               uint8 LVDiv, FUNSTATE State              |
| @return     : FSCSTATE : Success / Fail                |
--------------------------------------------------------*/

FSCSTATE LVD_RST_Init(LVDRstDiv_Type LVDiv, FUNSTATE State)
{
	RSTCFG = (RSTCFG & 0xFC) | LVDiv;
	RSTCFG = (RSTCFG & 0xEF) | (State << 6);
	return FSC_SUCCESS;
}

/*-----------------------------------------------------------------------
|          END OF FLIE        (C) COPYRIGHT Gevico Electronics          | 
-----------------------------------------------------------------------*/



